package com.fx.device.controller.activit;


import com.fx.device.common.util.ReturnMessage;
import com.fx.device.service.activit.ProcessTaskService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/task")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ProcessTaskController {

    final private ProcessTaskService service;



    //获取我的代办任务
    @GetMapping(value = "/getTasks")
    public ReturnMessage<Object> getTasks() {
        return service.getTasks();
    }



    //完成待办任务
    @GetMapping(value = "/completeTask")
    public ReturnMessage<Object> completeTask(@RequestParam("taskID") String taskID) {
        return service.completeTask(taskID);

    }



    //渲染表单
    @GetMapping(value = "/formDataShow")
    public ReturnMessage<Object> formDataShow(@RequestParam("taskID") String taskID) {
        return service.formDataShow(taskID);

    }


    @PostMapping(value = "/formDataSave")
    public  ReturnMessage<Object> formDataSave(@RequestParam("taskID") String taskID,
                                     @RequestParam("formData") String formData) {

        return service.formDataSave(taskID,formData);



    }















}
